<template>
  <div class="searchdetail">
    <div class="title">
      <h3 @click="gotohome">返回首页</h3>
    </div>

    <div class="goodsshow" v-if="seagoods.length">
      <Shopitem v-for="list in seagoods" :key="list.goods_id" :list='list' class="active"></Shopitem>
    </div>
    <div v-else>
      <h3>没有找到您要的商品哦~</h3>
    </div>

  </div>
</template>

<script>
import Shopitem from '@/components/shopitem.vue'
import { mapState } from 'vuex'

export default {
  components: {
    Shopitem
  },
  computed: {
    ...mapState('goods', ['seagoods'])
  },
  methods: {
    gotohome() {
      this.$router.replace('/home')
      
    }
  }
}
</script>

<style scoped lang='less'>
.searchdetail {
  margin: 20px 20%;
  width: 100%;
  .title {
    border: 1px solid gray;
    width: 90px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    color: gray;
  }
  .goodsshow {
    display: flex;
    flex-wrap: wrap;
    width: 60%;
    margin-left: 10%;
    .active {
    }
  }
}
</style>